<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.agile.jfinal.model.CoreModel"%>
<%@page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add"    id="add"    href="#" target="dialog" width="800" height="400"><span>添加</span></a></li>
			<li><a class="delete" id="delete" href="#" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li>
			<li><a class="edit"   id="edit"   href="#" target="dialog"  width="800" height="400"><span>修改</span></a></li>
			<li class="line">line</li>
		</ul>
</div>
<div class="pageContent" style="padding:5px"> 
	<form onsubmit="return navTabSearch(this);" action="${path}/appMenu" method="post" onsubmit="return validateCallback(this,dialogAjaxDone)">

		<div class="panel" defH="40">
			<h1>请选择App</h1>
			<div class="pageFormContent nowrap">
				<!-- 查找带回公共页面 -->
					<%@ include file="/WEB-INF/jsp/pub/page_for_lookup.jsp" %> 
					<div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
			</div>
		</div>
	</form>
	<div class="divider"></div>
	<div class="tabs">
		<div class="tabsHeader">
			<div class="tabsHeaderContent">
				<ul>
					<li><a href="#"><span>菜单配置信息</span></a></li>
				</ul>
			</div>
		</div>
		<div class="tabsContent" >
			<div>
				<div layoutH="100%" style="float:left; display:block; overflow:auto; width:240px; border:solid 1px #CCC; line-height:21px; background:#fff">
				    ${tree}
				</div>
				
				<div id="formBox" class="unitBox" style="margin-left:246px;">
					<!--#include virtual="list1.html" -->
				</div>
	
			</div>
		</div>
		<div class="tabsFooter" >
			<div class="tabsFooterContent"></div>
		</div>
	</div>
	
</div>

<script type="text/javascript">

$('#add').click(function(){

	var inputlookup = $('#inputlookup').val();
	
	var pk_menu = $('#pk_menu').val();
	if(typeof(pk_menu) == "undefined"){
		$(this).attr("href","${path}/appMenu/addPage?appBasedoc.pk_basedoc="+inputlookup); 
	}else{
		alert("/appMenu/addPage?appBasedoc.pk_basedoc="+inputlookup+"&appMenu.pk_menu="+pk_menu);
		$(this).attr("href","${path}/appMenu/addPage?appBasedoc.pk_basedoc="+inputlookup+"&appMenu.pk_menu="+pk_menu);
	}
})

$('#edit').click(function(){

	var inputlookup = $('#inputlookup').val();
	
	var pk_menu = $('#pk_menu').val();
	
	if(typeof(pk_menu) == "undefined"){
		$(this).attr("href","${path}/appMenu/editPage?appBasedoc.pk_basedoc="+inputlookup); 
	}else{
		$(this).attr("href","${path}/appMenu/editPage?appBasedoc.pk_basedoc="+inputlookup+"&appMenu.pk_menu="+pk_menu);
	}
})

$('#delete').click(function(){

	var inputlookup = $('#inputlookup').val();
	
	var pk_menu = $('#pk_menu').val();
	
	if(typeof(pk_menu) == "undefined"){
		$(this).attr("href","${path}/appMenu/delModel?appBasedoc.pk_basedoc="+inputlookup); 
	}else{
		$(this).attr("href","${path}/appMenu/delModel?appBasedoc.pk_basedoc="+inputlookup+"&appMenu.pk_menu="+pk_menu);
	}
})
</script>

